package com.itlong.cloud.equip.app;

import com.itlong.cloud.POJO.DTO.app.AppDeviceOrderDTO;
import com.itlong.cloud.POJO.DTO.app.CreateDeviceMarkDTO;
import com.itlong.cloud.POJO.VO.app.*;
import com.itlong.cloud.POJO.VO.property.AppCloudElevatorRunState;
import com.itlong.cloud.POJO.VO.property.CloudElevatorVO;
import com.itlong.cloud.POJO.VO.property.MiniCloudElevatorRunStateVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 * APP设备信息业务处理暴露接口
 * </desc>
 *
 * @createDate 2017/10/23
 */
@FeignClient(name = "equip-service")
public interface IAppDeviceServiceClient {
    /**
     * <desc>
     * 获取用户门禁设备列表
     * </desc>
     *
     * @param userId    用户Id
     * @param projectId 项目Id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/10/23
     */
    @RequestMapping(path = "/app/device/getDoorDevices", method = RequestMethod.POST)
    List<AppDoorDevicesVO> getDoorDevices(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId, @RequestParam("updateCache") Integer updateCache) throws Exception;

    /**
     * <desc>
     * 获取用户电梯设备列表
     * </desc>
     *
     * @param userId    用户Id
     * @param projectId 项目Id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/10/23
     */
    @RequestMapping(path = "/app/device/getFloorDevices", method = RequestMethod.POST)
    List<AppFloorDevicesVO> getFloorDevices(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId, @RequestParam("updateCache") Integer updateCache);

    /**
     * <desc>
     * 获取用户电梯设备列表
     * </desc>
     *
     * @param userId      用户Id
     * @param projectId   项目Id
     * @param updateCache 是否更新缓存 1是 0否
     * @param arrearsType 是否限制用户楼层权限 8是
     * @return
     * @author Jiaqi.X
     * @createDate 2017/10/23
     */
    @RequestMapping(value = "/app/device/getFloorDevicesForPad", method = RequestMethod.POST)
    List<AppFloorDevicesVO> getFloorDevicesForPad(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId,
                                                  @RequestParam("updateCache") Integer updateCache, @RequestParam("arrearsType") Integer arrearsType);

    /**
     * <desc>
     * 获取用户云对讲设备列表
     * </desc>
     *
     * @param userId    用户Id
     * @param projectId 项目Id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/10/23
     */
    @RequestMapping(path = "/app/device/getCloudIntercoms", method = RequestMethod.POST)
    List<AppCloudIntercomsVO> getCloudIntercoms(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId, @RequestParam("updateCache") Integer updateCache) throws Exception;

    /**
     * <desc>
     * 根据用户查询云对讲设备房间
     * </desc>
     *
     * @param userId       用户Id
     * @param projectId    项目Id
     * @param deviceUnique 设备编号
     * @return
     * @author Qiang.S
     * @createDate 2019/06/10
     */
    @RequestMapping(path = "/app/device/getCloudIntercomRoomInfo", method = RequestMethod.POST)
    String getCloudIntercomRoomInfo(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId, @RequestParam("deviceUnique") String deviceUnique) throws Exception;

    /**
     * <desc>
     * 获取用户设备信息
     * </desc>
     *
     * @param userId     用户id
     * @param projectIds 项目id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/11/08
     */
    @RequestMapping(path = "/app/device/getUserDevicesList", method = RequestMethod.POST)
    List<AppGetUserDevicesListVO> getUserDevicesList(@RequestParam("userId") String userId, @RequestParam("projectIds") String projectIds) throws Exception;

    /**
     * <desc>
     * 更新设备排序值
     * <desc/>
     *
     * @param userId    用户id
     * @param projectId 项目id
     * @param orderDTOS 设备排序列表
     * @return
     * @author Chunjian.G
     * @createDate 2017-11-08
     */
    @RequestMapping(path = "/app/device/updateDeviceOrders", method = RequestMethod.POST)
    Integer updateDeviceOrders(@RequestParam("userId") String userId,
                               @RequestParam("projectId") String projectId,
                               @RequestBody List<AppDeviceOrderDTO> orderDTOS) throws Exception;


    /**
     * <desc>
     * 设置app用户二维码信息
     * </desc>
     *
     * @param userId    用户id
     * @param projectId 项目id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/11/15
     */
    @RequestMapping(path = "/app/device/setUserQrCode", method = RequestMethod.POST)
    public void setUserQrCode(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId,
                              @RequestParam(value = "roomid", required = false) String roomId) throws Exception;

    /**
     * <desc>
     * 获取用户无接触二维码
     * </desc>
     *
     * @param userId       用户编号
     * @param deviceUnique 设备编号
     * @param logicalFloor 楼层
     * @return
     * @author Qiang.S
     * @createDate 2020/02/28
     */
    @RequestMapping(path = "/user/getNoTouchQRCode", method = RequestMethod.POST)
    String getNoTouchQRCode(@RequestParam("userId") String userId, @RequestParam("deviceUnique") String deviceUnique,
                            @RequestParam("logicalFloor") String logicalFloor) throws Exception;

    /**
     * <desc>
     * 推送云对讲设备端拉取业主认证增量信息
     * </desc>
     *
     * @param projectId   项目id
     * @param userId      用户id
     * @param commandType 业务指令
     * @return
     * @author Jiaqi.X
     * @createDate 2017/11/23
     */
    @RequestMapping(path = "/app/device/pushCloudDeviceAuth", method = RequestMethod.POST)
    public Integer pushCloudDeviceAuth(@RequestParam(value = "projectId", required = false) String projectId,
                                       @RequestParam("userId") String userId,
                                       @RequestParam("commandType") Integer commandType) throws Exception;

    /**
     * <desc>
     * 获取授权二维码
     * </desc>
     *
     * @param projectId 项目id
     * @param tlv       仅二维码SDK调用时传
     * @return
     * @author Jiaqi.X
     * @createDate 2017/12/22
     */
    @RequestMapping(path = "/app/getAuthQrcode", method = RequestMethod.POST)
    String getAuthQrcode(@RequestParam("projectId") String projectId, @RequestParam(value = "tlv", required = false) String tlv) throws Exception;

    /**
     * <desc>
     * 获取项目云对讲启用状态
     * </desc>
     *
     * @param projectId
     * @return
     */
    @RequestMapping(path = "/app/getProjectIsSmartCommunity", method = RequestMethod.POST)
    public String getProjectIsSmartCommunity(@RequestParam("projectId") String projectId);

    /**
     * <desc>
     * 获取电梯实时状态
     * </desc>
     *
     * @param deviceUnique 设备序列号 多个,号分隔
     * @param userId
     * @return
     * @author Jiaqi.X
     * @createDate 2018/04/10
     */
    @RequestMapping(path = "/app/getCloudElevatorState", method = RequestMethod.POST)
    List<AppCloudElevatorRunState> getCloudElevatorState(@RequestParam("deviceUnique") String deviceUnique,
                                                         @RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     * 获取电梯实时状态(小程序)
     * </desc>
     *
     * @param deviceUnique 设备序列号 多个,号分隔
     * @param userId
     * @return
     * @author Jiaqi.X
     * @createDate 2018/11/29
     */
    @RequestMapping(path = "/mini/getCloudElevatorStateForMini", method = RequestMethod.POST)
    List<MiniCloudElevatorRunStateVO> getCloudElevatorStateForMini(@RequestParam("deviceUnique") String deviceUnique,
                                                                   @RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     * 预约呼梯
     * </desc>
     *
     * @param deviceUnique  设备序列号
     * @param sourceFrom    来源 （app传itlong）
     * @param startingFloor 起始楼层（真实楼层）
     * @param gotoFloor     目的楼层（真实楼层）
     * @param floor         呼梯楼层（真实楼层）多个，号分隔
     * @param callType      呼梯类型 对应枚举类 CloudElevatorCallTypeEnum+
     * @param ctrElevator   强制控制电梯：1是 0否
     * @return
     * @author shengen.T
     * @createDate 2018/04/12
     */
    @RequestMapping(path = "/app/cloudElevatorCall",method = RequestMethod.POST)
    Boolean cloudElevatorCall(@RequestParam("deviceUnique") String deviceUnique,@RequestParam(value = "sourceFrom",required = false) String sourceFrom,
                              @RequestParam(value = "startingFloor",required = false) String startingFloor,@RequestParam(value = "gotoFloor",required = false) String gotoFloor,
                              @RequestParam(value = "floor",required = false)String floor,@RequestParam("callType")Integer callType,@RequestParam(value = "seconds",required = false) Integer seconds,
                              @RequestParam(value = "callSource",required = false)Integer callSource,@RequestParam(value = "robotId",required = false) String robotId,
                              @RequestParam(value = "snr",required = false) String snr,@RequestParam(value = "ctrElevator",required = false) Integer ctrElevator,
                              @RequestParam(value = "isAPI",required = false) Integer isAPI, @RequestParam(value = "upDown",required = false) String upDown,
                              @RequestParam(value = "userId",required = false) String userId,
                              @RequestParam(value = "requestId",required = false) String requestId
    );

    /**
     * <desc>
     * 开放或自动登记楼层
     * </desc>
     *
     * @param deviceUnique 设备序列号
     * @param sourceFrom   来源 （app传itlong）
     * @param floor        呼梯楼层（真实楼层）多个，号分隔
     * @param callType     呼梯类型 对应枚举类 CloudElevatorCallTypeEnum
     * @param seconds      秒
     * @return
     * @author Jiaqi.X
     * @createDate 2018/04/12
     */
    @RequestMapping(path = "/app/openOrAutoRegister",method = RequestMethod.POST)
    Boolean openOrAutoRegister(@RequestParam(value = "deviceUnique",required = false) String deviceUnique,
                               @RequestParam(value = "sourceFrom",required = false) String sourceFrom,
                               @RequestParam(value = "floor",required = false) String floor,
                               @RequestParam(value = "callType",required = false) Integer callType,
                               @RequestParam(value = "seconds",required = false) Integer seconds,
                               @RequestParam(value = "callSource",required = false) Integer callSource,
                               @RequestParam(value = "isRobot",required = false) String isRobot,
                               @RequestParam(value = "userId",required = false) String userId);


    /**
     * <desc>
     * 设置云电梯专梯模式
     * </desc>
     *
     * @param deviceUnique
     * @author Jiaqi.X
     * @createDate 2019/01/22
     */
    @RequestMapping(path = "/app/setCloudElevatorSpecialUseModel", method = RequestMethod.POST)
    void setCloudElevatorSpecialUseModel(@RequestParam("deviceUnique") String deviceUnique, @RequestParam("model") String model) throws Exception;

    /**
     * <desc>
     * <p>
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/04/11
     */
    @RequestMapping(path = "/app/getCallElevatorInfo", method = RequestMethod.POST)
    CloudElevatorVO getCallElevatorInfo(@RequestParam("deviceUnique") String deviceUnique);

    /**
     * <desc>
     * 根据设备唯一码获取门禁类型
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author Jugaung.S
     * @createDate 2019/05/26
     */
    @RequestMapping(path = "/app/getEntranceTypeInfo", method = RequestMethod.POST)
    Integer getEntranceTypeInfo(@RequestParam("deviceUnique") String deviceUnique);

    /**
     * <desc>
     * 用户读取欠费消息
     * </desc>
     *
     * @return 欠费消息
     * @author wangzhi
     * @createDate 2019/05/28
     */
    @RequestMapping(path = "/app/getArrearageInfo", method = RequestMethod.POST)
    Map<String, String> getArrearageInfo(@RequestParam("projectId") String projectId, @RequestParam(value = "roomId", required = false) String roomId, @RequestParam("deviceUnique") String deviceUnique,
                                         @RequestParam(value = "userId", required = false) String userId, @RequestParam("type") String type, @RequestParam("deviceType") String deviceType) throws Exception;

    /**
     * <desc>
     * 根据设备序列号查询绑定控制器
     * </desc>
     *
     * @param elevatorDeviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/04/28
     */
    @RequestMapping(path = "/app/getControllerDeviceUniqueByElevatorDeviceUnique", method = RequestMethod.POST)
    Map<String, Object> getControllerDeviceUniqueByElevatorDeviceUnique(@RequestParam("elevatorDeviceUnique") String elevatorDeviceUnique);

    /**
     * <desc>
     * 更新个人设备排序值
     * </desc>
     *
     * @param userId        用户编号
     * @param projectId     项目编号
     * @param deviceUniques 设备编号逗号分隔
     * @return
     * @author Qiang.S
     * @createDate 2019/08/07
     */
    @RequestMapping(path = "/app/uploadDeviceOrder", method = RequestMethod.POST)
    Integer uploadDeviceOrder(@RequestParam("userId") String userId,
                              @RequestParam("projectId") String projectId, @RequestParam("deviceUniques") String deviceUniques, @RequestParam("deviceType") String deviceType);

    /**
     * <desc>
     * 获取个人设备排序信息
     * </desc>
     *
     * @param userId    用户编号
     * @param projectId 项目编号
     * @return
     * @author Qiang.S
     * @createDate 2019/08/07
     */
    @RequestMapping(path = "/app/getUserDeviceOrder", method = RequestMethod.POST)
    String getUserDeviceOrder(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId);

    /**
     * <desc>
     * 获取个人电梯设备排序信息
     * </desc>
     *
     * @param userId    用户编号
     * @param projectId 项目编号
     * @return 个人电梯设备排序信息
     * @author wangzhi
     * @createDate 2019/10/09
     */
    @RequestMapping(path = "/app/getUserElevatorOrder", method = RequestMethod.POST)
    String getUserElevatorOrder(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId);

    /**
     * <desc>
     * 获取用户常用楼层
     * 根据楼层名称获取实际楼层和权限标识
     * </desc>
     *
     * @param floors
     * @param deviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/08/15
     */
    @RequestMapping(path = "/app/getFloorNumAndNaturalFloorByLogicFloor", method = RequestMethod.POST)
    Map<String, Object> getFloorNumAndNaturalFloorByLogicFloor(@RequestParam("floors") String floors, @RequestParam("deviceUnique") String deviceUnique);

    /**
     * <desc>
     * 获取当前用户的临时权限
     * </desc>
     *
     * @param userId    用户Id
     * @param projectId 项目Id
     * @return
     * @author Juguang.S
     * @createDate 2019/09/02
     */
    @RequestMapping(path = "/app/device/getUserDevicesInfo", method = RequestMethod.POST)
    List<AppUserDevicesVO> getUserDevicesInfo(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     * 保存或修改访客的设备标签
     * </desc>
     *
     * @param deviceMarkDTO 创建或修改标签的信息
     * @return
     * @author Juguang.S
     * @createDate 2019/09/02
     */
    @RequestMapping(path = "/app/device/saveOrUpdateDeviceMark", method = RequestMethod.POST)
    String saveOrUpdateDeviceMark(@RequestBody CreateDeviceMarkDTO deviceMarkDTO) throws Exception;

    /**
     * <desc>
     * 获取用户常用楼层
     * </desc>
     *
     * @param userId    用户编号
     * @param projectId 项目编号
     * @return 用户常用楼层
     * @author wangzhi
     * @createDate 2019/10/11
     */
    @RequestMapping(path = "/app/getUserCommonFloor", method = RequestMethod.POST)
    String getUserCommonFloor(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception;


    /**
     * <desc>
     * 获取用户常用公共楼层
     * </desc>
     *
     * @param userId    用户编号
     * @param projectId 项目编号
     * @return 用户常用公共楼层
     * @author pengwei
     * @createDate 2020-11-13
     */
    @RequestMapping(path = "/app/getUserPublicFloor", method = RequestMethod.POST)
    String getUserPublicFloor(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception;


    /**
     * <desc>
     * 获取当前用户的设备标签
     * </desc>
     *
     * @return
     * @author Juguang.S
     * @createDate 2019/09/02
     */
    @RequestMapping(path = "/app/device/getDeviceMark", method = RequestMethod.POST)
    List<VisitorDeviceMarkInfoVO> getDeviceMark(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     * 删除设备标签
     * </desc>
     *
     * @param markId 标签ID
     * @return
     * @author Juguang.S
     * @createDate 2019/09/03
     */
    @RequestMapping(path = "/app/device/deleteDeviceMark", method = RequestMethod.POST)
    Integer deleteDeviceMark(@RequestParam("markId") String markId) throws Exception;

    /**
     * <desc>
     * 根据房间编号和项目编号获取房间下的业主编号
     * </desc>
     *
     * @param roomId    房间ID
     * @param projectId 项目ID
     * @return
     * @author Juguang.S
     * @createDate 2019/09/03
     */
    @RequestMapping(path = "/app/device/getOwnerUserIdByroomId", method = RequestMethod.POST)
    String getOwnerUserIdByroomId(@RequestParam("roomId") String roomId, @RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     * 获取当前用户的临时电梯设备列表
     * </desc>
     *
     * @param userId    用户Id
     * @param projectId 项目Id
     * @return
     * @author Juguang.S
     * @createDate 2019/09/04
     */
    @RequestMapping(path = "/app/device/getUserTemporaryAuthFloorDevices", method = RequestMethod.POST)
    List<AppFloorDevicesVO> getUserTemporaryAuthFloorDevices(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     * 获取项目的云服务费最小过期时间
     * </desc>
     *
     * @param projectId 项目Id
     * @return 项目的云服务费最小过期时间
     * @author wangzhi
     * @createDate 2020/02/26
     */
    @RequestMapping(path = "/app/device/getProjectCloudServiceCostMaxEndTime", method = RequestMethod.POST)
    String getProjectCloudServiceCostMinEndTime(@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     * 查询蓝牙外呼设备
     * </desc>
     *
     * @param deviceUniques
     * @return
     * @author Jiaqi.X
     * @createDate 2020/04/17
     */
    @RequestMapping(path = "/app/device/getOutCallDevices", method = RequestMethod.POST)
    List<AppOutCallDevicesVO> getOutCallDevices(@RequestParam("deviceUniques") String deviceUniques, @RequestParam("cardNum") String cardNum);

    /*
     *      获取游客模式下有公共楼层的电梯设备
     * </desc>
     *
     * @param projectId 项目Id
     * @return 游客模式下有公共楼层的电梯设备
     * @author wangzhi
     * @createDate 2020/05/06
     */
    @RequestMapping(path = "/app/device/getGuestFloorList", method = RequestMethod.POST)
    List<AppFloorDevicesVO> getGuestFloorList(@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     * 获取个人电梯、群控器设备排序信息
     * </desc>
     *
     * @param userId    用户编号
     * @param projectId 项目编号
     * @return 个人电梯、群控器设备排序信息
     * @author wangzhi
     * @createDate 2020/05/07
     */
    @RequestMapping(path = "/app/device/getUserElevatorControllerOrder", method = RequestMethod.POST)
    String getUserElevatorControllerOrder(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception;


    /**
     * <desc>
     * 用户是否是vip
     * <desc/>
     *
     * @param userId    用户编号
     * @param projectId 项目编号
     * @return
     * @author pengwei
     * @createDate 2020-11-13
     */
    @RequestMapping(path = "/app/device/appUserIsVip", method = RequestMethod.POST)
    boolean appUserIsVip(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception;


    /**
     * <desc>
     * 获取公共楼层和常用楼层
     * </desc>
     *
     * @param projectId 项目编号
     * @Author chengshican
     * @Date 2020-11-19 16:35
     * @Param userId 用户编号
     * @Return
     * @Exception
     */
    @RequestMapping(path = "/app/device/getAppCommonAndPublicByUserId", method = RequestMethod.POST)
    Map<String, Object> getAppCommonAndPublicByUserId(@RequestParam("userId") String userId, @RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *     是否vip预约呼梯中
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/12/27 14:43
     */
    @RequestMapping(path = "/app/device/getIsVipCall", method = RequestMethod.POST)
    Boolean getIsVipCall(@RequestParam("deviceUnique") String deviceUnique);



    /**
     * <desc>
     * 通过门禁设备机号查询门禁所在地址
     * </desc>
     *
     * @author: chengshican
     *  @Date: 2021-01-04 12:11
     *
     */
    @RequestMapping(path = "/app/device/getDeviceEntranceBridgeInfoByDeviceUnique", method = RequestMethod.POST)
    List<Map> getDeviceEntranceBridgeInfoByDeviceUnique(@RequestParam("deviceUnique") String deviceUnique);


    /**
     * <desc>
     * 通过平板设备机号查询所在地址
     * </desc>
     *
     * @author: chengshican
     *  @Date: 2021-01-04 12:11
     *
     */
    @RequestMapping(path = "/app/device/getPadBridgeInfoByDeviceUnique", method = RequestMethod.POST)
    List<Map> getPadBridgeInfoByDeviceUnique(@RequestParam("deviceUnique") String deviceUnique);







    /**
     * <desc>
     *      获取用户标签
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2021/1/4 17:18
     */
    @RequestMapping(path = "/app/device/getUserLabel", method = RequestMethod.POST)
    String getUserLabel(@RequestParam("userId") String userId,  @RequestParam("projectId") String projectId);

    /**
     * <desc>
     * 预约呼梯仅供于前海嘉里非标项目调用
     * </desc>
     *
     * @param deviceUnique  设备序列号
     * @param startingFloor 起始楼层（真实楼层）
     * @param gotoFloor     目的楼层（真实楼层）
     * @return
     * @author Juguang.S
     * @createDate 2020-03-11
     */
    @RequestMapping(path = "/app/cloudElevatorCallByNonStandard",method = RequestMethod.POST)
    Map<String,String> cloudElevatorCallByNonStandard(@RequestParam("deviceUnique") String deviceUnique,
                                                      @RequestParam(value = "startingFloor",required = false) String startingFloor,
                                                      @RequestParam(value = "gotoFloor",required = false) String gotoFloor,
                                                      @RequestParam(value = "userId",required = false) String userId) throws Exception;
}
